﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Security;
using System.Text;
using System.Threading.Tasks;

namespace ModelLayer
{
    [DataContract]
    public class User
    {
        public User(string firstName, string lastName, string profileName, string email, char gender, string password, Status status)
        {
            FirstName = firstName;
            LastName = lastName;
            ProfileName = profileName;
            Email = email;
            Gender = gender;
            Password = password;
            CurrentStatus = status;
            Achievements = new List<Achievement>();
        }

        public User()
        {
            Achievements = new List<Achievement>();
        }

        [DataMember]
        public int UserId { get; set; }

        [DataMember]
        public string FirstName { get; set; }

        [DataMember]
        public string LastName { get; set; }

        [DataMember]
        public string ProfileName { get; set; }

        [DataMember]
        public string Email { get; set; }

        [DataMember]
        public char Gender { get; set; }

        [DataMember]
        public string Password { get; set; }

        public enum Status
        {
            Active = 0,
            InActive = 1,
            Deleted = 2
        }

        [DataMember]
        public List<Achievement> Achievements { get; set; }

        [DataMember]
        public Status CurrentStatus { get; set; }

        public void AddAchievement(Achievement achievement)
        {
            Achievements.Add(achievement);
        }
    }
}